<?php
session_start();
error_reporting(1);
//BASE_DIR
include "init-script.php";

// /uploads/images/1/2011/09/thumb-130-100/435-1315710048.jpg           mid:3,thumbDir:6,fileName:7
// /uploads/images/1/2011/09/435-1315710048.jpg                         mid:3,fileName:6


$thumbImage = '/uploads/images/1/2011/09/thumb-130-100/435-1315710048.jpg';
$realImagePath = '/uploads/images/1/2011/09/435-1315710048.jpg';



$arrThumbImage = explode('/',$thumbImage);
$arrRealImagePath = explode('/',$realImagePath);


$sql = "SELECT * FROM images";
$rs = $db->query($sql);
while ($row = $db->fetch_array($rs)) {
	$arrThumbImage = explode('/',$row['image']);
	$arrRealImagePath = explode('/',$row['real_image']);
	$mid = $row['mid'];
	$aid = $row['aid'];
	$newDir = BASE_DIR.'/uploads/images/' . $mid . '' . $aid;
	if (!file_exists($newDir)) {
        if(!mkdir($newDir, 0777,true)) {
            echo "Error create directory!";die;
        }
    }
	
	$arrayThumbImageFileName = explode('-',$arrThumbImage[7]);
	$arrayRealImageFileName = explode('-',$arrRealImagePath[6]);
	
	$oldDateThumbImageFileName = 
	
	$newThumbImageFileName = trim(Date('Y-m-d-').str_replace(''));

}
    


?>
